<template>
  <el-header class="header">
    <el-row type="flex" justify="space-between" align="center">
      <el-col>
        <el-menu mode="horizontal" router :default-active="$route.path">
          <div class="logo"><img src="../assets/logo.jpg" alt="Logo" height="55" width=100 /></div>
          <el-menu-item index="/tasteHome" class="item">网站首页</el-menu-item>
          <el-menu-item index="/community" class="item">美食社区</el-menu-item>
          <el-menu-item index="/canteen" class="item">餐厅预约</el-menu-item>
          <el-menu-item index="/order" class="item">个人订单</el-menu-item>
        </el-menu>
        <div class="right-buttons">
          当前登录：
          <router-link v-if="isLoggedIn" to="/userInfo" class="username">{{ username }}</router-link>
          <router-link v-else to="/login" class="login-link">未登录</router-link>
        </div>
      </el-col>
    </el-row>
  </el-header>
</template>

<script>
export default {
  name: 'NormalHeader',
  props: {
    isLoggedIn: Boolean,
    username: String
  }
};
</script>

<style scoped>
.header {
  background-color: #43678e;
  padding: 0;
  margin: 0 10px;
}

.right-buttons {
  display: flex;
  align-items: center;
  justify-content: flex-end;
}

.item {
  border: none;
}

.username {
  font-size: 16px;
  color: #333;
  margin-left: 10px;
  text-decoration: none;
}

.username:hover {
  color: #4a688a;
}

.login-link {
  font-size: 16px;
  color: #4a688a;
  text-decoration: none;
}
</style>
